package com.zhuxin.timer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 貌似Scheduled和Transactional两个注解冲突....
 * 分开两个吧
 */
@Component
//@Transactional("")
public class TimerApp {
    @Autowired
    private TimerJobs send;

    /**
     * 每5秒调用一次send最近7秒的数据
     * @throws Exception
     */
    @Scheduled(cron="0/5 * * * * ? ")
    public void sendInfo() throws Exception {
        send.sendWxInfo();
    }

    /**
     * 每1分钟调用一次失效请求
     * @throws Exception
     */
    @Scheduled(cron="0 0/1 * * * ? ")
    public void disLog() throws Exception {
        send.disLog();
    }
}
